export const now = new Date();
export const nowYear = (now.getFullYear()).toString();
export const nowMonth = (now.getMonth()+1).toString();
export const tableOption = {
    border: true,
    index: true,
    indexLabel: '序号',
    stripe: true,
    menuAlign: 'center',
    align: 'center',
    dialogWidth:'70%',
    printBtn: false,
    searchSize: 'mini',
    addBtn: false,
    delBtn: false,
    editBtn: false,
    selection: true,
    selectable: row => {
      return row.checkStatus == '0' || row.checkStatus == '3'
    },
    searchMenuSpan: 6,
    column: [{
        label: '标识',
        prop: 'id',
        hide: true,
        display: false
      }, {
        label: '单号',
        prop: 'numbers',
        display: false,
        search: true,
      }, {
        label: '年份',
        prop: 'workTime',
        type: 'year',
        format: 'yyyy',
        valueFormat: 'yyyy',
        search: true,
        searchValue: nowYear, 
        display: false
      },{
      label: '月份',
      prop: 'planMonth',
      type: 'select',
      dicUrl: '/admin/dict/type/plan_month_cycle',
      // type: 'month',
      // format: 'MM',
      // valueFormat: 'MM',
      disabled: true,
      search: true,
      searchValue: nowMonth, 
      formatter: (row,value,label,column) => {
        if(value){
          return value.split(',').map(m=>m+'月').join(',')
        }
      }
    }, {
        label: '周期(周)',
        prop: 'workCycle',
        type: 'select',
        dicUrl: '/admin/dict/type/plan_week_cycle',
        hide:true,
        display: false
    }, 
    {
        label: '周',
        prop: 'planWeek',
        disabled: true,
        search: true,
        type: 'select',
        dicUrl: '/admin/dict/type/plan_week_cycle',
      },
       {
        label: '已分解周',
        prop: 'decomposeWeek',
        disabled: true,
        formatter: (row,value,label,column) => {
          if(value){
            return value.split(',').map(m=>m+'周').join(',')
          }
        }
    
      },  {
      label: '工作类型',
      prop: 'planType',
      type: 'select',
      dicUrl: '/admin/dict/type/plan_type',
      disabled: true,
      rules: [{
        required: true,
        message: '请选择计划类型',
        trigger: 'blur'
      }]
    }, {
      label: '票种',
      prop: 'ticketType',
      type: 'select',
      dicUrl: '/support/swpmticketcardtype/dict',
      props: {
        label: 'mainName',
        value: 'mainEnName'
      },
      search: true,
      disabled: true,
      rules: [{
        required: true,
        message: '请选择票种',
        trigger: 'blur'
      }]
    }, {
      label: '原计划数量',
      prop: 'planNumberOld',
      type: 'number',
      precision: 0,
      disabled: true,
      rules: [{
        required: true,
        message: '请输入原计划数量',
        trigger: 'blur'
      }]
    }, {
      label: '现计划数量',
      prop: 'planNumberNow',
      type: 'number',
      precision: 0,
      cell: true,
      rules: [{
        required: true,
        message: '请输入现计划数量',
        trigger: 'blur'
      }],
      width: 150
    }, {
      label: '已分解数量',
      prop: 'decomposeNumber',
      type: 'number',
      disabled: true,
      precision: 0,
      rules: [{
        required: true,
        message: '请输入已分解数量',
        trigger: 'blur'
      }]
    }, {
      label: '审批状态',
      prop: 'checkStatus',
      type: 'select',
      dicUrl: '/admin/dict/type/check_status',
      search: true,
      searchValue: '0', 
      addDisplay: false,
      editDisplay: false
    }, {
      label: '审核人',
      prop: 'checkPersonId',
      hide: true,
      addDisplay: false,
      editDisplay: false
    }, {
      label: '审核时间',
      prop: 'checkTime',
      hide: true,
      addDisplay: false,
      editDisplay: false
    }, {
      label: '是否分解完毕',
      prop: 'isDecompose',
      type: 'select',
      dicData: [{
        label: '是',
        value: '1'
      }, {
        label: '否',
        value: '0'
      }],
      search: true,
      searchLabelWidth: 100
    },{
      label: '是否修改现计划',
      prop: 'whetherStatus',
      type: 'select',
      search: true,
      dicData: [{
        label: '是',
        value: '1'
      }, {
        label: '否',
        value: '0'
      }]
    },{
      label: '运营商',
      prop: 'operator',
      display: false,
      search: true
    }, {
      label: '备注',
      prop: 'remark',
      type: 'textarea',
      maxRows:6,
      minRows:4
    }, {
      label: '创建人ID',
      prop: 'creatorId',
      hide: true,
      display: false
    }, {
      label: '创建人名称',
      prop: 'creatorName',
      hide: true,
      display: false
    }, {
      label: '创建时间',
      prop: 'createtime',
      hide: true,
      display: false
    }]
  };
  
  export const tableOptionEdit = {
    border: true,
    index: true,
    indexLabel: '序号',
    stripe: true,
    menuAlign: 'center',
    align: 'center',
    dialogWidth:'70%',
    printBtn: false,
    searchSize: 'mini',
    addBtn: false,
    delBtn: false,
    editBtn: false,
    searchMenuSpan: 6,
    column: [{
        label: '标识',
        prop: 'id',
        hide: true,
        display: false
      }, {
        label: '单号',
        prop: 'numbers',
        display: false,
        disabled: true,
      }, {
        label: '年份',
        prop: 'workTime',
        type: 'year',
        format: 'yyyy',
        valueFormat: 'yyyy',
        search: true,
        searchValue: nowYear, 
        display: false
      },{
      label: '月份',
      prop: 'planMonth',
      type: 'select',
      dicUrl: '/admin/dict/type/plan_month_cycle',
      disabled: true,
      search: true,
      searchValue: nowMonth, 
      formatter: (row,value,label,column) => {
        if(value){
          return value.split(',').map(m=>m+'月').join(',')
        }
      }
    }, {
        label: '周期(周)',
        prop: 'workCycle',
        type: 'select',
        dicUrl: '/admin/dict/type/plan_week_cycle',
        hide:true,
        display: false
    }, 
    {
        label: '周',
        prop: 'planWeek',
        disabled: true,
        search: true,
        type: 'select',
        dicUrl: '/admin/dict/type/plan_week_cycle',
      },
       {
        label: '已分解周',
        prop: 'decomposeWeek',
        disabled: true,
        formatter: (row,value,label,column) => {
          if(value){
            return value.split(',').map(m=>m+'周').join(',')
          }
        }
    
      },  {
      label: '工作类型',
      prop: 'planType',
      type: 'select',
      dicUrl: '/admin/dict/type/plan_type',
      disabled: true,
      rules: [{
        required: true,
        message: '请选择计划类型',
        trigger: 'blur'
      }]
    }, {
      label: '票种',
      prop: 'ticketType',
      type: 'select',
      dicUrl: '/support/swpmticketcardtype/dict',
      props: {
        label: 'mainName',
        value: 'mainEnName'
      },
      search: true,
      disabled: true,
      rules: [{
        required: true,
        message: '请选择票种',
        trigger: 'blur'
      }]
    }, {
      label: '原计划数量',
      prop: 'planNumberOld',
      type: 'number',
      precision: 0,
      disabled: true,
      rules: [{
        required: true,
        message: '请输入原计划数量',
        trigger: 'blur'
      }]
    }, {
      label: '现计划数量',
      prop: 'planNumberNow',
      type: 'number',
      precision: 0,
      cell: true,
      rules: [{
        required: true,
        message: '请输入现计划数量',
        trigger: 'blur'
      }],
      width: 150
    }, {
      label: '已分解数量',
      prop: 'decomposeNumber',
      type: 'number',
      disabled: true,
      precision: 0,
      rules: [{
        required: true,
        message: '请输入已分解数量',
        trigger: 'blur'
      }]
    }, {
      label: '审批状态',
      prop: 'checkStatus',
      type: 'select',
      dicUrl: '/admin/dict/type/check_status',
      search: true,
      searchValue: '0', 
      addDisplay: false,
      editDisplay: false
    }, {
      label: '审核人',
      prop: 'checkPersonId',
      hide: true,
      addDisplay: false,
      editDisplay: false
    }, {
      label: '审核时间',
      prop: 'checkTime',
      hide: true,
      addDisplay: false,
      editDisplay: false
    }, {
      label: '是否分解完毕',
      prop: 'isDecompose',
      type: 'select',
      dicData: [{
        label: '是',
        value: '1'
      }, {
        label: '否',
        value: '0'
      }],
      search: true,
      searchLabelWidth: 100
    },{
      label: '是否修改现计划',
      prop: 'whetherStatus',
      type: 'select',
      search: true,
      dicData: [{
        label: '是',
        value: '1'
      }, {
        label: '否',
        value: '0'
      }]
    },{
      dataType: "string",
      type: "upload",
      label: "附件",
      prop: "receiptFilePath",
      cell: true,
      component: "zd-upload",
      limit: 1,
      width: 120
    },  {
      label: '备注',
      prop: 'remark',
      type: 'textarea',
      maxRows:6,
      minRows:4
    }, {
      label: '创建人ID',
      prop: 'creatorId',
      hide: true,
      display: false
    }, {
      label: '创建人名称',
      prop: 'creatorName',
      hide: true,
      display: false
    }, {
      label: '创建时间',
      prop: 'createtime',
      hide: true,
      display: false
    }]
  };
   
  export const tableOptionView = {
    border: true,
    index: true,
    indexLabel: '序号',
    stripe: true,
    menuAlign: 'center',
    align: 'center',
    dialogWidth:'70%',
    printBtn: false,
    searchSize: 'mini',
    addBtn: false,
    delBtn: false,
    editBtn: false,
    searchMenuSpan: 6,
    column: [{
        label: '标识',
        prop: 'id',
        hide: true,
        display: false
      }, {
        label: '单号',
        prop: 'numbers',
        display: false,
        disabled: true,
      }, {
        label: '年份',
        prop: 'workTime',
        type: 'year',
        format: 'yyyy',
        valueFormat: 'yyyy',
        search: true,
        searchValue: nowYear, 
        display: false
      },{
      label: '月份',
      prop: 'planMonth',
      type: 'select',
      dicUrl: '/admin/dict/type/plan_month_cycle',
      disabled: true,
      search: true,
      searchValue: nowMonth, 
      formatter: (row,value,label,column) => {
        if(value){
          return value.split(',').map(m=>m+'月').join(',')
        }
      }
    }, {
        label: '周期(周)',
        prop: 'workCycle',
        type: 'select',
        dicUrl: '/admin/dict/type/plan_week_cycle',
        hide:true,
        display: false
    }, 
    {
        label: '周',
        prop: 'planWeek',
        disabled: true,
        search: true,
        type: 'select',
        dicUrl: '/admin/dict/type/plan_week_cycle',
      },
       {
        label: '已分解周',
        prop: 'decomposeWeek',
        disabled: true,
        formatter: (row,value,label,column) => {
          if(value){
            return value.split(',').map(m=>m+'周').join(',')
          }
        }
    
      },  {
      label: '工作类型',
      prop: 'planType',
      type: 'select',
      dicUrl: '/admin/dict/type/plan_type',
      disabled: true,
      rules: [{
        required: true,
        message: '请选择计划类型',
        trigger: 'blur'
      }]
    }, {
      label: '票种',
      prop: 'ticketType',
      type: 'select',
      dicUrl: '/support/swpmticketcardtype/dict',
      props: {
        label: 'mainName',
        value: 'mainEnName'
      },
      search: true,
      disabled: true,
      rules: [{
        required: true,
        message: '请选择票种',
        trigger: 'blur'
      }]
    }, {
      label: '原计划数量',
      prop: 'planNumberOld',
      type: 'number',
      precision: 0,
      disabled: true,
      rules: [{
        required: true,
        message: '请输入原计划数量',
        trigger: 'blur'
      }]
    }, {
      label: '现计划数量',
      prop: 'planNumberNow',
      type: 'number',
      precision: 0,
      cell: true,
      rules: [{
        required: true,
        message: '请输入现计划数量',
        trigger: 'blur'
      }],
      width: 150
    }, {
      label: '已分解数量',
      prop: 'decomposeNumber',
      type: 'number',
      disabled: true,
      precision: 0,
      rules: [{
        required: true,
        message: '请输入已分解数量',
        trigger: 'blur'
      }]
    }, {
      label: '审批状态',
      prop: 'checkStatus',
      type: 'select',
      dicUrl: '/admin/dict/type/check_status',
      search: true,
      searchValue: '0', 
      addDisplay: false,
      editDisplay: false
    }, {
      label: '审核人',
      prop: 'checkPersonId',
      hide: true,
      addDisplay: false,
      editDisplay: false
    }, {
      label: '审核时间',
      prop: 'checkTime',
      hide: true,
      addDisplay: false,
      editDisplay: false
    }, {
      label: '是否分解完毕',
      prop: 'isDecompose',
      type: 'select',
      dicData: [{
        label: '是',
        value: '1'
      }, {
        label: '否',
        value: '0'
      }],
      search: true,
      searchLabelWidth: 100
    },{
      label: '是否修改现计划',
      prop: 'whetherStatus',
      type: 'select',
      search: true,
      dicData: [{
        label: '是',
        value: '1'
      }, {
        label: '否',
        value: '0'
      }]
    },{
      type: "upload",
      label: "回执单附件路径",
      prop: "receiptFilePath",
      slot: true
    },  {
      label: '备注',
      prop: 'remark',
      type: 'textarea',
      maxRows:6,
      minRows:4
    }, {
      label: '创建人ID',
      prop: 'creatorId',
      hide: true,
      display: false
    }, {
      label: '创建人名称',
      prop: 'creatorName',
      hide: true,
      display: false
    }, {
      label: '创建时间',
      prop: 'createtime',
      hide: true,
      display: false
    }]
  };
  